package com.oracle.application.controller;

import com.oracle.application.feign.MemberFeign;
import com.oracle.application.feign.vo.Member;
import com.oracle.application.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/member")
public class MemberController {
    @Autowired
    private MemberFeign memberFeign;

    @GetMapping("/getMemberByLoginName")
    public R<Member> getMemberByLoginName(@RequestParam("loginName") String loginName){
        return this.memberFeign.getMemberByLoginName(loginName);
    }
    @PostMapping("/addMember")
    public R<Member> addMember(@RequestBody Member member){
        return this.memberFeign.addMember(member);
    }
    @GetMapping("/checkEmail")
    public R<Member> checkEmail(@RequestParam("loginName") String loginName, @RequestParam("email") String email, @RequestParam("id") String id){
        return this.memberFeign.checkEmail(loginName, email, id);
    }
}
